import java.util.ArrayList;


public class PatientArrivesEvent extends EventBase {
	protected PatientBase patient;
	

	public PatientArrivesEvent(PatientBase patient, int timeUntilExecution) {
		super(timeUntilExecution);
		this.patient = patient;
	}

	public boolean canOccur(State s) {
		if(!super.canOccur(s))
			return false;
		
		// otherwise we may be able to execute
		return true;
	}


	
	public void execute(State state) {
		state.waitingRoom.add(patient);
		patient.setActivity(TreatmentType.Registration);
		patient.complete(TreatmentType.Registration);
	}
}